public class J01Add {
    public static void main(String[] args) {
        /*
        //++，--，自增，自减
        int a = 3;
        a++;// a = a + 1;
        System.out.println("a = " + a);

        short s1 = 3;
        s1++;
        System.out.println("s1 = " + s1);

        int b = 6;
        b--;
        b--;
        System.out.println("b = " + b);
        System.out.println("======");
        int c = 5;
//        c++;
        ++c;
        System.out.println("c = " + c);
        */

        /*
        ++在前，在后的时候，如果不赋值，没有区别，
           如果赋值有区别
                ++前置，先自增，再参与运算
                ++后置，先参与运算，再自增
         */
//        int d = 5;
//        int e = d++;//5
////        int e = ++d;//6
//
//        System.out.println("e = " + e);
//
//        int num1 = 7;
//        int num2 = num1--;
//        //num1 = 6
//        int num3 = --num1;
//
//        System.out.println("num2 = " + num2);//7
//        System.out.println("num3 = " + num3);//5



        int a = 10;
        int b = 10;

        int c = ++a;
        int d = b++;
        System.out.println(c);//c是几？  11
        System.out.println(d);//d是几？  10
        //e = 11*2 + 11%5
//        int e = (c++)*2 + (++d) % 5; //23
        //  e = 11*2 + 13%5 = 22 + 3 = 25
        int e = c++ * 2 + (++c) % 5; //
        System.out.println(e);//e是几？a,b,c,d分别是几？


        int m = 3;
        int n = m++;
        System.out.println("n = " + n);//3
        System.out.println("m = " + m);//4

        /*



         */
    }
}
